raar.register
Class RARandomReal

java.lang.Object
  extended by raar.register.RAReal
      extended by raar.register.RARandomReal
All Implemented Interfaces:
java.io.Serializable, RAAssignable, RAEqualityComparable, RAFullComparable, RAMathObject, RAAllowed, RAAllowedEverywhere, RAAllowedInList, RAAllowedInType, RADataType, RAElemDataType, RANonElemDataType

public class RARandomReal
extends RAReal
implements java.io.Serializable

Class RARandomReal represents a random real (double precision number x with 0<=x<1) in the RAAR environment. Every time you request this random's dValue, a different random number is returned. You can store the num- ber in an ordinary RAReal to have a persistent value.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.register.RAReal
TOLERANCE
 
Constructor Summary
RARandomReal()
          Construct a random real.
 
Method Summary
 double dValue()
          Return a new random value between 0 inclusive and 1 exclusive.
 boolean equals(RAEqualityComparable otherMathObject)
          Returns true if this real is equal to the parameter.
 boolean larger(RAFullComparable r)
          Returns true if this real is larger than r.
 boolean largerEquals(RAFullComparable r)
          Returns true if this real is larger than r or equals.
 boolean smaller(RAFullComparable r)
          Returns true if this real is smaller than r.
 boolean smallerEquals(RAFullComparable r)
          Returns true if this real is smaller than r or equals r.
 java.lang.String toString()
          String representation of this real.
 RADataType value()
          Return this object (for compatibility with RADataType).
 
Methods inherited from class raar.register.RAReal
canContain, clone, getType, makeClone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RARandomReal

public RARandomReal()
Construct a random real.

Method Detail

value

public RADataType value()
                 throws RAException
Return this object (for compatibility with RADataType).

Specified by:
value in interface RAAssignable
Specified by:
value in interface RAMathObject
Overrides:
value in class RAReal
Returns:
Duh...
Throws:
RAException

dValue

public double dValue()
              throws RAException
Return a new random value between 0 inclusive and 1 exclusive.

Overrides:
dValue in class RAReal
Returns:
Duh...
Throws:
RAException

toString

public java.lang.String toString()
String representation of this real.

Overrides:
toString in class RAReal

equals

public boolean equals(RAEqualityComparable otherMathObject)
               throws RAException
Returns true if this real is equal to the parameter. Overridden to return false since the value is dynamic.

Specified by:
equals in interface RAEqualityComparable
Overrides:
equals in class RAReal
Parameters:
a - real...
Returns:
true or false
Throws:
RAException

larger

public boolean larger(RAFullComparable r)
               throws RAException
Returns true if this real is larger than r. Overridden to return false since the value is dynamic.

Specified by:
larger in interface RAFullComparable
Overrides:
larger in class RAReal
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

smaller

public boolean smaller(RAFullComparable r)
                throws RAException
Returns true if this real is smaller than r. Overridden to return false since the value is dynamic.

Specified by:
smaller in interface RAFullComparable
Overrides:
smaller in class RAReal
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

largerEquals

public boolean largerEquals(RAFullComparable r)
                     throws RAException
Returns true if this real is larger than r or equals. Overridden to return false since the value is dynamic.

Specified by:
largerEquals in interface RAFullComparable
Overrides:
largerEquals in class RAReal
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException

smallerEquals

public boolean smallerEquals(RAFullComparable r)
                      throws RAException
Returns true if this real is smaller than r or equals r. Overridden to return false since the value is dynamic.

Specified by:
smallerEquals in interface RAFullComparable
Overrides:
smallerEquals in class RAReal
Parameters:
r - Another real bites the dust
Returns:
true or false, see above.
Throws:
RAException